import { processList,delProcess,pubProcess,addInstance,myTaskList,completeTask,myHiTaskList,findListLcbds,addLcbds,editLcbds,deleteLcbds } from '@/api/lcgl.js'
const state = {}
const mutations = {}
const actions = {
  processList({ commit }, data) {
    return new Promise((resolve, reject) => {
      processList(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
  })
  },
  delProcess({ commit }, data) {
    return new Promise((resolve, reject) => {
      delProcess(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  pubProcess({ commit }, data) {
    return new Promise((resolve, reject) => {
      pubProcess(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  addInstance({ commit }, data) {
    return new Promise((resolve, reject) => {
      addInstance(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  myTaskList({ commit }, data) {
    return new Promise((resolve, reject) => {
      myTaskList(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  completeTask({ commit }, data) {
    return new Promise((resolve, reject) => {
      completeTask(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  myHiTaskList({ commit }, data) {
    return new Promise((resolve, reject) => {
      myHiTaskList(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  findListLcbds({ commit }, data) {
    return new Promise((resolve, reject) => {
      findListLcbds(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  },
  addLcbds({ commit }, data) {
    return new Promise((resolve, reject) => {
      addLcbds(data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  }, 
  editLcbds ({ commit }, data) {
    return new Promise((resolve, reject) => {
      editLcbds (data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  }, 
  deleteLcbds({ commit }, data) {
    return new Promise((resolve, reject) => {
      deleteLcbds (data).then((res) => {
        resolve(res)
      }).catch((err) => { reject(err) })
    })
  }, 
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
